var circle = new Sonic({
    width: 100,
    height: 100,
    stepsPerFrame: 4,
    trailLength: 1,
    pointDistance: 0.01,
    fps: 25,
    fillColor: "#FF7B24",
    setup: function () {
        this._.lineWidth = 10
    },
    step: function (d, a, c) {
        var b = 360 * d.progress,
            e = Math.PI / 180 * b,
            b = Math.PI / 180 * (b - 180);
        a *= 5;
        this._.fillRect(25 * Math.cos(e) + (50 - a / 2), 15 * Math.sin(e) + (50 - a / 2), a, a);
        this._.fillStyle = "#63D3FF";
        this._.fillRect(15 * Math.cos(b) + (50 - a / 2), 25 * Math.sin(b) + (50 - a / 2), a, a);
        1 == d.progress && (this._.globalAlpha = 0.5 > c ? 1 - c : c, this._.fillStyle = "#EEE", this._.beginPath(), this._.arc(50,
        50, 5, 0, 360, 0), this._.closePath(), this._.fill())
    },
    path: [
        ["line", 40, 10, 60, 90]
    ]
});
circle.play();
var wadah = document.getElementById("muatan");
wadah.appendChild(circle.canvas);
!function ($) {
	$(function(){
		var $window = $(window);
		// Google Prettify
		window.prettyPrint && prettyPrint();
		// Slide Carousel Loader
		$('#myCarousel').carousel();
		$(window).on('load',function(){
			$('.memuat').fadeOut('slow');
			setTimeout(function() {
					$('.memuat').fadeOut('slow');
			}, 2000);
			return false;
		});
		$('.memuat').click(function(){
      $(this).fadeOut('slow');
    });
		// Footer SlideUp SlideDown
		$('#open-foot').show();
		var slide = false;
		var height = $('.footer').height();
		$('#open-foot').on('click',function() {
			var docHeight = $(document).height();
			var windowHeight = $(window).height();
			var scrollPos = docHeight - windowHeight + height;
			$('.footer').animate({ height: "toggle"}, 1000, 'easeOutBounce');
			if(slide == false) {
				if($.browser.opera) {
					$('html').animate({scrollTop: scrollPos+'px'}, 1000, 'easeOutBounce');
				} else {
					$('html, body').animate({scrollTop: scrollPos+'px'}, 1000, 'easeOutBounce');
				}
				slide = true;
			} else {
				slide = false;
			}
		});
		// Scroll To Top
		$('#atas').click(function(){
			$('html, body').animate({scrollTop:0}, 1500, 'easeOutBounce');
		});
		// Responsive Video
		$(".video").fitVids();
		$(".video").fitVids({ customSelector: "iframe[src^='http://socialcam.com']"});
		// Tooltip
		$('[rel=tooltip]').tooltip();
		// Popover
		$("a[rel=popover]").popover().click(function(e) {
				 e.preventDefault()
		});
	})
}(window.jQuery)